﻿<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>spchol200_ex1_pageload</Title>
      <Shortcut>spchol200_ex1_pageload</Shortcut>
      <Description>Code snippet for SPCHOL200 Ex1 PageLoad</Description>
      <Author>Microsoft Corporation</Author>    
    </Header>
    <Snippet>
      <Code Language="VB">
        <![CDATA[
Dim dc As New SPLinqDataContext(SPContext.Current.Web.Url)

Dim Employees As EntityList(Of EmployeesItem) = _
dc.GetList(Of EmployeesItem)("Employees")

Dim empQuery = From emp In Employees _
    Where emp.Project.DueDate < DateTime.Now.AddMonths(6) _
    Select emp.Title, emp.JobTitle, ProjectTitle = emp.Project.Title, _
    DueDate = emp.Project.DueDate.ToString()

spGridView.DataSource = empQuery
spGridView.DataBind()
]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
